package system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import common.model.po.SysAuthority;
import common.model.response.base.Result;
import system.model.request.SaveRoleAuthorityRequest;

import java.util.Map;

/**
 * 服务类
 *
 * @author 米泽鹏
 * @since 2022-03-11
 */
public interface SysAuthorityService extends IService<SysAuthority> {

	/**
	 * 查询权限树所需信息
	 */
	Map<String, Object> getAuthorityInfoFromCache();

	/**
	 * 权限新增或更新
	 *
	 * @param po SysAuthority
	 * @return Result
	 */
	Result<?> saveAuthority(SysAuthority po);

	/**
	 * 权限删除
	 *
	 * @param id 权限id
	 * @return Result
	 */
	Result<?> deleteAuthority(Long id);

	/**
	 * 保存角色权限
	 *
	 * @param request SaveRoleAuthorityRequest
	 * @return Result
	 */
	Result<?> saveRoleAuthority(SaveRoleAuthorityRequest request);

}
